package com.zhang.servicemap.service.impl;

import com.zhang.internalcommon.dto.ResponseResult;
import com.zhang.internalcommon.response.DirectionResponse;
import com.zhang.servicemap.remote.MapDirectionClient;
import com.zhang.servicemap.service.DirectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DirectionServiceImpl implements DirectionService {
	@Autowired
	private MapDirectionClient mapDirectionClient;
	@Override
	public ResponseResult driving(String depLongitude, String depLatitude, String destLongitude, String destLatitude) {
		// DirectionResponse directionResponse = new DirectionResponse();
		DirectionResponse direction = mapDirectionClient.direction(depLongitude, depLatitude, destLongitude, destLatitude);
		return ResponseResult.success(direction);
	}
}
